<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('会员信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>会员ID：</p>
                                <input type="text" name="memberId"/>
                            </li>
                            <li>
                                <p>昵称：</p>
                                <input type="text" name="nikeName"/>
                            </li>
                            <li>
                                <p>性别，0，男，1，女，2，未知：</p>
                                <select name="sex" th:with="type=${@dict.getType('sys_user_sex')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li class="select-time">
                                <p>生日：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginBirthday]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endBirthday]"/>
                            </li>
                            <li>
                                <p>手机号：</p>
                                <input type="text" name="mobilePhone"/>
                            </li>
                            <li>
                                <p>所在城市：</p>
                                <input type="text" name="city"/>
                            </li>
                            <li>
                                <p>种养殖经验：</p>
                                <input type="text" name="experience"/>
                            </li>
                            <li>
                                <p>用户角色，0，农户达人，1，农业专家：</p>
                                <input type="text" name="role"/>
                            </li>
                            <li>
                                <p>微信unionId：</p>
                                <input type="text" name="unionid"/>
                            </li>
                            <li>
                                <p>小程序openid：</p>
                                <input type="text" name="mpOpenid"/>
                            </li>
                            <li>
                                <p>APP微信openid：</p>
                                <input type="text" name="appOpenid"/>
                            </li>
                            <li>
                                <p>系统生成的UUID,用于确保用户的唯一属性：</p>
                                <input type="text" name="sysUuid"/>
                            </li>
                            <li>
                                <p>关注焦点标签：</p>
                                <input type="text" name="focusTags"/>
                            </li>
                            <li>
                                <p>专家标签：</p>
                                <input type="text" name="expertTags"/>
                            </li>
                            <li>
                                <p>账户积分：</p>
                                <input type="text" name="score"/>
                            </li>
                            <li>
                                <p>会员等级：</p>
                                <input type="text" name="rank"/>
                            </li>
                            <li>
                                <p>账户状态，0，正常，1，冻结：</p>
                                <select name="status">
                                    <option value="">所有</option>
                                </select>
                            </li>
                            <li>
                                <p>注册系统名称：</p>
                                <input type="text" name="regSys"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="agriculture:member:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="agriculture:member:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="agriculture:member:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="agriculture:member:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('agriculture:member:edit')}]];
        var removeFlag = [[${@permission.hasPermi('agriculture:member:remove')}]];
        var sexDatas = [[${@dict.getType('sys_user_sex')}]];
        var prefix = ctx + "agriculture/member";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "会员信息",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'memberId', 
                    title : '会员ID',
                    visible: false
                },
                {
                    field : 'nikeName', 
                    title : '昵称'
                },
                {
                    field : 'sex', 
                    title : '性别，0，男，1，女，2，未知',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(sexDatas, value);
                    }
                },
                {
                    field : 'birthday', 
                    title : '生日'
                },
                {
                    field : 'personalSignature', 
                    title : '个性签名'
                },
                {
                    field : 'headImg', 
                    title : '用户头像'
                },
                {
                    field : 'mobilePhone', 
                    title : '手机号'
                },
                {
                    field : 'city', 
                    title : '所在城市'
                },
                {
                    field : 'experience', 
                    title : '种养殖经验'
                },
                {
                    field : 'role', 
                    title : '用户角色，0，农户达人，1，农业专家'
                },
                {
                    field : 'unionid', 
                    title : '微信unionId'
                },
                {
                    field : 'mpOpenid', 
                    title : '小程序openid'
                },
                {
                    field : 'appOpenid', 
                    title : 'APP微信openid'
                },
                {
                    field : 'sysUuid', 
                    title : '系统生成的UUID,用于确保用户的唯一属性'
                },
                {
                    field : 'focusTags', 
                    title : '关注焦点标签'
                },
                {
                    field : 'expertTags', 
                    title : '专家标签'
                },
                {
                    field : 'score', 
                    title : '账户积分'
                },
                {
                    field : 'rank', 
                    title : '会员等级'
                },
                {
                    field : 'status', 
                    title : '账户状态，0，正常，1，冻结'
                },
                {
                    field : 'lastLoginTime', 
                    title : '最后一次登录时间'
                },
                {
                    field : 'regSys', 
                    title : '注册系统名称'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.memberId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.memberId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>